package com.xhwl.centiotdata.pushtrigger.eesd;

import com.xhwl.centiotdata.handler.eesd.impl.EesdWaterMeterHandler;
import com.xhwl.common.pojo.ResultJson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Leon
 * @Description: TODO
 * @Date: 2021/12/21 15:41
 */
@RestController
@RequestMapping("/")
@Slf4j
public class WaterMeterController {

    @Autowired
    EesdWaterMeterHandler eesdWaterMeterHandler;

    @PostMapping("/water-meter-receive/huaWei-iot-receive")
    public ResultJson huaWeiIotWaterMeterReceive(@RequestBody String huaWeiIotWaterMeter){
        log.info("======================>华为Iot推送水表数据为：{}",huaWeiIotWaterMeter);
        eesdWaterMeterHandler.pushIotDAReceiveData(huaWeiIotWaterMeter);
        return ResultJson.success();
    }
}
